package xyz.jcat.common.enums;

public enum YesNoEnum implements IBusinessEnum<Integer, YesNoEnum> {

    YES(1, "是"),
    NO(0, "否");

    private Integer code;
    private String text;

    YesNoEnum(Integer code, String text) {
        this.code = code;
        this.text = text;
    }

    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getText() {
        return this.text;
    }

    @Override
    public YesNoEnum[] getVales() {
        return YesNoEnum.values();
    }

    public static boolean yes(Integer code) {
        return YES.code.equals(code);
    }
}
